package com.ruoyi.zhgd.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.zhgd.domain.vo.NAsphaltOutputPieVo;
import com.ruoyi.zhgd.domain.vo.NAsphaltOutputStatisticsVo;
import com.ruoyi.zhgd.service.NAsphaltOutputStatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 沥青产量统计分析控制器
 *
 * @author tll
 * @date 2023-10-12
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/zhgd/asphaltOutputStatistics")
public class NAsphaltOutputStatisticsController extends BaseController {

    private final NAsphaltOutputStatisticsService nAsphaltOutputStatisticsService;

    /**
     * 历年产量数据
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/listForYear")
    public R<List<NAsphaltOutputStatisticsVo>> listForYear(@RequestParam Map<String, Object> params) {
        return R.ok(nAsphaltOutputStatisticsService.listForYear(params));
    }

    /**
     * 月产量数据
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/listForMonth")
    public R<List<NAsphaltOutputStatisticsVo>> listForMonth(@RequestParam Map<String, Object> params) {
        return R.ok(nAsphaltOutputStatisticsService.listForMonth(params));
    }

    /**
     * 日产量数据
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/listForDay")
    public R<List<NAsphaltOutputStatisticsVo>> listForDay(@RequestParam Map<String, Object> params) {
        return R.ok(nAsphaltOutputStatisticsService.listForDay(params));
    }

    /**
     * 项目产量数据
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/listForProject")
    public R<NAsphaltOutputPieVo> listForProject(@RequestParam Map<String, Object> params) {
        return R.ok(nAsphaltOutputStatisticsService.listForProject(params));
    }

    /**
     * 配方产量数据
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/listForMatch")
    public R<NAsphaltOutputPieVo> listForMatch(@RequestParam Map<String, Object> params) {
        return R.ok(nAsphaltOutputStatisticsService.listForMatch(params));
    }

}
